<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<!--#include file="lib/saferequest.asp"-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<link rel="stylesheet" href="lib/sheet.css" type="text/css">
</head>
<%
If Not Session("MM_Reg") Then
	response.write("您没有登陆，请登陆后使用!<br>")
	response.write "<a href='javascript:history.go(-1)'> << 返回上一页</a><br> "
	response.end
End If
if Session("MM_Username")<>"admin" then
	response.write("您不是管理员！<br>")
	response.write "<a href='javascript:history.go(-1)'> << 返回上一页</a><br> "
	response.End
end if
%>

<body>

<%

if 	SafeRequest(("updatelog"),0)="提交" then
	updatelog_date=trim(SafeRequest("updatelog_date",0))
	updatelog_post=SafeRequest("updatelog_post",1)
	updatelog_memo=trim(SafeRequest("updatelog_memo",0))


	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection = conn
	sql="insert into updatelog(updatelog_date,updatelog_post,updatelog_memo) values('"&updatelog_date&"',"&updatelog_post&",'"&updatelog_memo&"')"
	cmd.CommandText = sql
	cmd.Execute
	cmd.ActiveConnection.Close
	view_url="updatelog.asp"
	response.Redirect(view_url)
end if	
	
%>

<form method="post" action="#">
时间：<input name="updatelog_date" value="<%=date()%>" /><br />
岗位：<select name="updatelog_post">
				<option value="0">用户权限</option>
				<option value="1">船务岗位</option>
				<option value="2">车队岗位</option>
				<option value="3">商务岗位</option>
				<option value="4">财务岗位</option>
			</select><br />
内容：<textarea cols="80" name="updatelog_memo"></textarea><br />
<input type="submit" name="updatelog" value="提交" />

</form>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT *  FROM updatelog order by updatelog_date desc,updatelog_post asc,updatelog_id desc"
rs.Open sql,conn,1,1
%>
<table border="1">
	<tr>
		<th>id</th>
		<th>date</th>
		<th>post</th>
		<th>memo</th>
	</tr>
<%
do while not rs.eof
%>
	<tr>
		<td><%=rs("updatelog_id")%></td>
		<td><%=rs("updatelog_date")%></td>
		<td><%=rs("updatelog_post")%></td>
		<td><%=rs("updatelog_memo")%></td>
	</tr>
<%
	rs.movenext
loop
%>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
